//
//  UIButton+Extension.swift
//  WB
//
//  Created by KenLiang on 16/4/7.
//  Copyright © 2016年 KenLiang. All rights reserved.
//

import UIKit

extension UIButton {
    //便利构造方法
    convenience init (imageName : String, bgImageName : String) {
        self.init()
        
        setImage(UIImage(named: imageName), forState: .Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: .Selected)
        setBackgroundImage(UIImage(named: bgImageName), forState: .Normal)
        setBackgroundImage(UIImage(named: bgImageName + "_highlighted"), forState: .Selected)
        self.sizeToFit()
    }
}
